<div class="row">
	<div class="col-md-4">
		<div class="panel panel-default">
			<div class="panel-heading">
				<h3 class="panel-title"><%= @activity.title %> </h3>
			</div>
			<div class="panel-body">
				<p> <%= @activity.desc %></p>
				<p>起始时间：<%= @activity.start_time %></p>
				<p>结束时间：<%= @activity.end_time %></p>
			</div>
		</div>

		<%#= link_to 'Edit', edit_activity_path(@activity) %> 
		<%#= link_to 'Back', activities_path %>
	</div>
	<div class="col-md-8">
		<table class="table">
			<thead>
				<tr>
					<th width="55%">奖品名称</th>
					<th width="15%">奖品数量</th>
					<th width="15%">中奖概率</th>
					<th width="15%" colspan=2></th>
				</tr>
			</thead>
			<tbody>
				<%for product in @activity.products%>
					<tr>
						<td><%=product.name%></td>
						<td><%=product.amount%></td>
						<td><%=product.probability%>%</td>
						<td><%= link_to '修改', edit_activity_product_path(@activity, product) %></td>
						<td><%= link_to '删除', activity_product_path(@activity, product), method: :delete, data: { confirm: 'Are you sure?' } %></td>
					</tr>
				<%end%>
			</tbody>
		</table>
		<%= link_to '添加奖品', new_activity_product_path(@activity) %>
	</div>
</div>
